package cn.edu.bupt.mybatis.mapper;

import cn.edu.bupt.mybatis.entity.Product;
import cn.edu.bupt.mybatis.vo.ProductWithComments;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ProductMapper {

    List<Product> findAll();
    int create(Product product);
    Product findById(@Param(value = "id") Long id);
    int deleteById(@Param(value = "id") Long id);

    //一对多级联----嵌套Select查询方案示例
    List<Map> findAllWithComments();
    //一对多级联----嵌套 结果映射方案示例
    List<ProductWithComments> findAllWithCommentsV2();

}
